package xyz.chaobei.execption;

import lombok.Getter;
import xyz.chaobei.enums.ErrorCodeEnum;

/**
 * 自定义异常信息，一般定义自我抛出的异常
 */
@Getter
public class ExceptionAbstract extends RuntimeException {

    private Integer code;
    private String message;

    public ExceptionAbstract(ErrorCodeEnum codeEnum) {
        this(codeEnum.getCode(), codeEnum.getMessage());
    }

    public ExceptionAbstract(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}
